<template>
	<view class="container">
		<view class="top">
			<view class="search-box">
				<headerSearch bgColor="#F6F6F6" placeholder="可通过名称、手机号搜索"></headerSearch>
			</view>
			<view class="order-tab">
				<view class="tab-item" :class="i==tab_index?'select':''" v-for="(item,i) in tabList" :key="i" @click="tab_index=i">
					<text>{{item.text}}</text>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="item" v-for="(item,i) in 6" :key="i">
				<view class="box-1">
					<view class="left">
						<image :src="$img_path('/mall/5.png')" mode="aspectFill"></image>
						<view class="info">
							<view class="name">
								李四（12345678910）
							</view>
							<view class="pf">
								服务评分：<text>95.0</text>
							</view>
						</view>
					</view>
					<view class="right">
						<view class="status">
							已冻结
						</view>
						<view class="time">
							（1天23时59分）
						</view>
					</view>
				</view>
				
				<view class="btn-box">
					<view class="w-116" @click="$refs.djDate.open()">冻结</view>
					<view class="w-116" @click="$refs.confrimBox.open()">解冻</view>
					<view class="w-116" @click="$refs.editFen.open()">调分</view>
					<view class="w-160" @click="toAppeal">申诉管理 <text>10</text> </view>
				</view>
			</view>
		</view>
		
		<uni-popup ref="djDate" background-color="#fff" type="bottom" @change="change" customClass="bgF">
			<view class="p-top">
				<view class="left" @click="close">取消</view>
				<view class="title">选择冻结日期</view>
				<view class="right" @click="confirm">确定</view>
			</view>
			<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
				<picker-view class="picker-view" indicator-style="height: 50px;" :immediate-change="true" mask-style="background:rgba(0,0,0,0)" :value="dateValue" @change="bindChange">
					<view class="center-bg"></view>
					<picker-view-column>
						<view class="item" v-for="(item,i) in dList" :key="i" :style="{color:i==dateValue[0] ? '#333333' : '#999999',fontSize:i==dateValue[0] ? '36rpx' : '32rpx'}">
							{{item.text}}
						</view>
					</picker-view-column>
				</picker-view>
			</view>
		</uni-popup>
		
		<popupBox ref="confrimBox" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					提示
				</view>
				<view class="c-text">
					你确定解冻？
				</view>
			</view>
		</popupBox>
		
		<popupBox ref="editFen" contentBG="#ffffff">
			<view class="popup-con">
				<view class="title">
					调分
				</view>
				<view class="con-check">
					<view class="radio-box">
						<view class="r-i">
							<image v-if="true" :src="$img_path('/pagesMine/14.png')" mode="widthFix"></image>
							<image v-else :src="$img_path('/pagesMine/15.png')" mode="widthFix"></image>
							<text>加分</text>
						</view>
						<view class="r-i">
							<image v-if="false" :src="$img_path('/pagesMine/14.png')" mode="widthFix"></image>
							<image v-else :src="$img_path('/pagesMine/15.png')" mode="widthFix"></image>
							<text>减分</text>
						</view>
					</view>
					
					<view class="inp-box">
						<input type="number" placeholder="请输入" />
					</view>
				</view>
			</view>
		</popupBox>
	</view>
</template>

<script>
	import popupBox from '@/components/popup/popup.vue'
	import headerSearch from '@/components/header-search/header-search.vue'
	export default {
		components:{
			headerSearch,
			popupBox
		},
		data() {
			return {
				tabList:[
					{
						text:'全部',
						value:1
					},{
						text:'已冻结',
						value:1
					},{
						text:'未冻结',
						value:1
					}
				],
				tab_index:0,
				
				dList:[
					{
						text:'6小时',
						value:1
					},{
						text:'12小时',
						value:2
					},{
						text:'1天',
						value:3
					},{
						text:'2天',
						value:4
					},{
						text:'3天',
						value:5
					},
				],
				dateValue:null
			};
		},
		methods:{
			//加分
			addFen(){
				
			},
			//减分
			jianFen(){
				
			},
			change(){},
			bindChange(val){
				console.log(val,'-')
			},
			close(){
				this.$refs.popup.close()
			},
			confirm(){
				this.close()
				
			},
			
			toAppeal(){
				uni.navigateTo({
					url:`/pagesRegion/freeze/appealManagement`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.container{
	.top{
		position: sticky;
		top: 0;
		left: 0;
		right: 0;
		z-index: 3;
		background-color: #FFFFFF;
		.search-box{
			padding: 14rpx 22rpx 0;
			header-search{
				height: 84rpx;
			}
		}
		.order-tab{
			padding: 24rpx 104rpx 12rpx; 
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: space-between;
			background-color: #FFFFFF;
			.tab-item{
				text{
					font-weight: 400;
					font-size: 32rpx;
					color: #333333;
					line-height: 44rpx;
					position: relative;
				}
				&.select{
					text{
						font-weight: bold;
						font-size: 32rpx;
						color: #E72A2A;
						line-height: 44rpx;
						&::after{
							content: '';
							width: 52rpx;
							height: 8rpx;
							background: #E72A2A;
							border-radius: 4rpx;
							position: absolute;
							top: calc(100% + 4rpx);
							left: 50%;
							transform: translateX(-50%);
						}
					}
				}
			}
		}
	}
	
	.list{
		padding: 0 22rpx;
		box-sizing: border-box;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		.item{
			padding: 28rpx 28rpx 38rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin-top: 20rpx;
			.box-1{
				display: flex;
				align-items: flex-start;
				justify-content: space-between;
				.left{
					display: flex;
					align-items: center;
					image{
						width: 116rpx;
						height: 116rpx;
						border-radius: 50%;
					}
					.info{
						padding-left: 20rpx;
						.name{
							font-weight: bold;
							font-size: 28rpx;
							color: #000000;
							line-height: 40rpx;
						}
						.pf{
							font-weight: 400;
							font-size: 26rpx;
							color: #333333;
							line-height: 36rpx;
							margin-top: 20rpx;
							text-align: left;
							text{
								color: #FFA33A;
							}
						}
					}
				}
				.right{
					display: flex;
					flex-direction: column;
					align-items: flex-end;
					.status{
						font-weight: bold;
						font-size: 28rpx;
						color: #FF4A4A;
						line-height: 40rpx;
					}
					.time{
						font-weight: bold;
						font-size: 20rpx;
						color: #FF4A4A;
						line-height: 28rpx;
					}
				}
			}
			.btn-box{
				display: flex;
				justify-content: flex-end;
				padding-top: 26rpx;
				&>view{
					height: 52rpx;
					background: #FFFFFF;
					border-radius: 8rpx;
					font-weight: bold;
					font-size: 28rpx;
					line-height: 52rpx;
					text-align: center;
					border: 2rpx solid #ffffff;
					&.w-116{
						width: 116rpx;
						margin-right: 20rpx;
					}
					&.w-160{
						width: 160rpx;
						position: relative;
						&>text{
							display: inline-block;
							position: absolute;
							width: 34rpx;
							height: 34rpx;
							background: #FF4A4A;
							border: 2rpx solid #FFFFFF;
							border-radius: 50%;
							font-weight: bold;
							font-size: 20rpx;
							color: #FFFFFF;
							line-height: 34rpx;
							text-align: center;
							right: 0;
							top: 0;
							transform: translateX(50%) translateY(-50%);
						}
					}
					&:nth-child(1){
						border-color: #FF4A4A;
						color: #FF4A4A;
					}
					&:nth-child(2){
						border-color: #37A45F;
						color: #37A45F;
					}
					&:nth-child(3){
						border-color: #0291FF;
						color: #0291FF;
					}
					&:nth-child(4){
						border-color: #333333;
						color: #333333;
					}
				}
			}
		}
	}
}


.popup-con{
	.title{
		text-align: center;
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding: 28rpx 0 70rpx;
	}
	.c-text{
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		line-height: 50rpx;
		padding-bottom: 66rpx;
	}
	.con-check{
		margin-top: -44rpx;
		.radio-box{
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 340rpx;
			margin: 0 auto;
			.r-i{
				display: flex;
				align-items: center;
				image{
					width: 40rpx;
					height: 40rpx;
				}
				text{
					font-weight: bold;
					font-size: 32rpx;
					color: #000000;
					line-height: 44rpx;
					margin-left: 16rpx;
				}
			}
		}
		.inp-box{
			width: 508rpx;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			border: 2rpx solid #B4B4B4;
			margin-top: 34rpx;
			margin-bottom: 54rpx;
			input{
				width: 100%;
				height: 100%;
				padding: 0 20rpx;
				box-sizing: border-box;
			}
		}
	}
}

	.p-top{
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		padding: 36rpx 28rpx 10rpx;
		box-sizing: border-box;
		.left{
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;
			line-height: 42rpx;
		}
		.title{
			font-weight: bold;
			font-size: 36rpx;
			color: #333333;
			line-height: 50rpx;
		}
		.right{
			font-weight: bold;
			font-size: 30rpx;
			color: #E72A2A;
			line-height: 42rpx;
		}
	}
	
	.popup-content{
		padding: 0 22rpx;
		box-sizing: border-box;
	}
	
	.picker-view {
		width: 100%;
		height: 510rpx;
		margin-top: 20rpx;
		position: relative;
		.center-bg{
			width: 100%;
			height: 102rpx;
			background-color: #F4F4F4;
			position: absolute;
			left: 0;
			top: 50%;
			transform: translateY(-50%);
			z-index: 0;
			border-radius: 16rpx;
		}
	}
	/deep/ .item {
		line-height: 102rpx;
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 36rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
	}
	.button-b{
		display: flex;
		justify-content: space-between;
		button{
			width: 300rpx;
			height: 82rpx;
			border-radius: 41rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 30rpx;
			line-height: 82rpx;
			text-align: center;
			font-style: normal;
			text-transform: none;
			&:first-child{
				background-color: #F5F5F5;
				color: #777777;
			}
			&:last-child{
				background-color: #FD5100;
				color: #FFFFFF;
				margin-left: 24rpx;
			}
		}
	}
</style>
